<?php
/**
 * 栏目验证器
 * @author maniac
 */
namespace app\common\validate;

class Columns extends Base
{
    // 验证规则
    protected $rule = [
        'name'   => 'require',
        'mod_id' => 'number|gt:0',
        'id'     => 'containSub',
    ];
    
    // 错误信息
    protected $message = [
        'name'   => '请输入栏目名称',
        'mod_id' => '请选择所属系统模型',
        'id'     => '请先删除栏目下的信息',
    ];
    
    // 验证场景
    protected $scene = [
        'add' => ['name', 'mod_id'],
        'id'  => ['del']
    ];
}
